package com.xiangyang.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.springframework.web.bind.annotation.RequestBody;

//药房订单
@Data
@NoArgsConstructor
@SuperBuilder
@AllArgsConstructor
@TableName(value = "drug")
public class Drug extends BaseEntity{
    @TableId(value = "prescription_Id",type = IdType.AUTO)
     private Long prescriptionId;//处方id
    private String drugName;//药品名称
    private Integer drugNumber;//药品数量
    private String drugType; //药品类型
    private String frequency;//用药频率
    private String courseOfTreatment;//疗程
    private String createdAt;//创建时间
    // 重写 BaseEntity 的 getId 和 setId 方法
   @Override
    public Long getId() {
        return getPrescriptionId();
    }

    @Override
    public void setId(Long prescriptionId) {
        setPrescriptionId(prescriptionId);
    }



    public void setPostId(Long prescriptionId) {
        this.prescriptionId = prescriptionId;
        // 同步设置 BaseEntity 的 id
        super.setId(prescriptionId);
    }
}
